/**
 * Created by w2ex on 7/20/16.
 */
'use strict'

export const addClass = (node, className) => {
    node.className += ' ' + className
}

export const removeClass = (node, className) => {
    let classes = node.className.split(' ')
    classes.forEach((name, i) => {
        if (name == className) {
            classes.splice(1, i)
        }
    })
    node.className = classes.join(' ')
}

export const setBodyBgColor = (color) => {
    document.body.style.backgroundColor = color
}

export const setBodyClassName = (className) => {
    document.body.className = className
}

export const setTitle = (title) => {
    document.title = title
}

export const getScreenSize = () => {
    return {
        height: window.screen.availHeight,
        width: window.screen.availWidth
    }
}

